<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/register.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:52 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>篮球社团管理 - 注册</title>
    <meta name="keywords" content="篮球,社团,管理系统,社">
    <meta name="description" content="高校篮球社团管理系统，计算机等相关的技术，将各社员与学校管理联系起来实现即时信息通讯，为老师学生节约了大量的时间与精力，并大大提高了学校管理工作的效率与质量，同时精简了学校的管理机构。">

    <link rel="shortcut icon" href="/static/favicon.ico"> <link href="/static/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/static/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/css/animate.min.css" rel="stylesheet">
    <link href="/static/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
    <script>var g = '男';</script>
</head>

<body class="gray-bg">

<div class="middle-box text-center loginscreen   animated fadeInDown">
    <div>
        <div>

            <h1 class="logo-name">篮</h1>

        </div>
        <h3>欢迎注册 H+</h3>
        <p>创建一个新账户</p>
    <#--        <form class="m-t" role="form" onsubmit="return register();" action="/userRegister">-->
        <div class="form-group">
            <input type="text" name="username" class="form-control" placeholder="请输入学号" required="">
        </div>
        <div class="form-group">
            <input type="text" name="uname" class="form-control" placeholder="请输入姓名" required="">
        </div>
        <label class="col-sm-3 control-label">性别：</label>
        <div class="col-sm-9">
            <label class="radio-inline">
                <input onclick="javascript:g = '男';" type="radio" checked="" value="男" id="optionsRadios1" name="gender">男</label>
            <label class="radio-inline">
                <input onclick="(g = '女')" type="radio" value="女" id="optionsRadios2" name="gender">女</label>
        </div>
        <div class="form-group">
            <input type="text" name="department" class="form-control" placeholder="请输入院系" required="">
        </div>
        <div class="form-group">
            <input type="text" name="class_" class="form-control" placeholder="请输入班级" required="">
        </div>
        <div class="form-group">
            <input type="text" name="qq" class="form-control" placeholder="请输入QQ号" required="">
        </div>
        <div class="form-group">
            <input type="password" name="password1" class="form-control" placeholder="请输入密码" required="">
        </div>
        <div class="form-group">
            <input type="password" name="password" class="form-control" placeholder="请再次输入密码" required="">
        </div>
        <div class="form-group text-left">
            <div class="checkbox i-checks">
                <label class="no-padding">
                    <input type="checkbox"><i></i> 我同意注册协议</label>
            </div>
        </div>
        <button type="submit" onclick="register()" class="btn btn-primary block full-width m-b">注册</button>

        <p class="text-muted text-center"><small>已经有账户了？</small><a href="/login">点此登录</a>
        </p>

    <#--        </form>-->
    </div>
</div>
<script src="/static/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/static/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
</script>
<script>
    function register() {
        if ($('input[name="password"]').val() != $('input[name="password1"]').val()){
            alert("两次输入密码不一致")
            return
        }
        $.ajax({
            url: '/userRegister',
            type: 'post',
            dataType: 'json',
            data: {
                username: $('input[name="username"]').val(),
                uname: $('input[name="uname"]').val(),
                department: $('input[name="department"]').val(),
                class_: $('input[name="class_"]').val(),
                qq: $('input[name="qq"]').val(),
                password: $('input[name="password"]').val(),
                gender: g
            },
            error: function(data){
                console.log("错误")
                console.log(data)
            },
            success: function(data){
                console.log(data)
                console.log(data.success)
                if (data.success) {
                    alert("注册成功！请登录")
                    location.href = "/login"
                }else{
                    alert("注册失败，请检查")
                }
            },
            fail: function(data){
                console.log(data)
            }

        })
    }
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/register.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:52 GMT -->
</html>
